using Microsoft.SharePoint;

namespace RealDolmen.SharePoint.ListFeatures
{
    public class ListFeatureEventReceiverProperties
    {
        #region Fields
        private ListFeature feature;
        private ListFeatureDefinition definition;
        private SPList list;
        private bool cancel = false;
        private string cancelMessage; 
        #endregion // Fields

        #region Constructors
        protected internal ListFeatureEventReceiverProperties(ListFeature feature)
        {
            Feature = feature;
        }

        protected internal ListFeatureEventReceiverProperties(ListFeatureDefinition definition, SPList list)
        {
            Definition = definition;
            List = list;
        } 
        #endregion // Constructors

        #region Properties
        public ListFeature Feature
        {
            get { return feature; }
            protected internal set
            {
                feature = value;
                definition = value.Definition;
                list = value.ParentList;
            }
        }

        public ListFeatureDefinition Definition
        {
            get { return definition; }
            protected internal set { definition = value; }
        }

        public SPList List
        {
            get { return list; }
            protected internal set { list = value; }
        }

        public bool Cancel
        {
            get { return cancel; }
            set { cancel = value; }
        }

        public string CancelMessage
        {
            get { return cancelMessage; }
            set { cancelMessage = value; }
        } 
        #endregion // Properties
    }
}
